package cn.edu.mapper;

import cn.edu.pojo.All;
import cn.edu.pojo.teacher;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author Davey chan
 */
public interface ExamineMapper {
//    修改审核状态
    @Update("update teacher set Examstatus='2' where teacherID=#{id}")
    void agree(Integer id);
    @Update("update teacher set Examstatus='0' where teacherID=#{id}")
    void disagree(Integer id);
//    未审核分页查询加上未审核状态和学院名的限制条件
//    @Select("select * from teacher where Examstatus='1' and academyName like #{academyName} limit #{begin},#{size}")
    List<All> selectBypage(@Param("begin") int begin, @Param("size")int size, @Param("academyName") String academyName);
//    查询总记录数
    @Select("select count(*) from teacher where Examstatus='1'")
    int selectTotalCount();
    //    已审核分页查询
    @Select("select * from teacher where Examstatus='2' and academyName like #{academyName} limit #{begin},#{size}")
    List<teacher> selectBypage2(@Param("begin") int begin, @Param("size")int size,@Param("academyName") String academyName);
//查询已审核的记录数
    @Select("select count(*) from teacher where Examstatus='2'")
    int selectTotalCount2();
//    取消审核
   @Update("update teacher set Examstatus='1' where teacherID=#{id}")
    void cancle(Integer id);
}
